home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 February
/
EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso
/
earcd
/
util4
/
aman-115.lha
/
aman-1.15
/
Source
/
aman.c
next >
Wrap
C/C++ Source or Header
|
1995-07-21
|
4KB
|
185 lines
#ifndef MAKE_ID
#define MAKE_ID(a,b,c,d) ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d))
#endif
#ifdef _DCC
#define __inline
#endif
#include "aman.h"
#include "amanExtern.h"
#include "version.h"
struct ObjApp * CreateApp(void)
{
struct ObjApp * Object;
APTR MN_Project, MN_Project_About, MN_Project_Quit, GR_aman, GR_pattern;
APTR LA_pattern, GR_listview;
static const struct Hook lv_confuncHook = { { NULL,NULL },(VOID *)lv_confunc,NULL,NULL };
static const struct Hook lv_desfuncHook = { { NULL,NULL },(VOID *)lv_desfunc,NULL,NULL };
if (!(Object = AllocVec(sizeof(struct ObjApp), MEMF_PUBLIC|MEMF_CLEAR)))
return(NULL);
LA_pattern = Label("Pattern");
Object->STR_pattern = StringObject,
MUIA_Frame, MUIV_Frame_String,
MUIA_ControlChar, 's',
MUIA_HelpNode, "STR_pattern",
End;
GR_pattern = GroupObject,
MUIA_HelpNode, "GR_pattern",
MUIA_Group_Horiz, TRUE,
Child, LA_pattern,
Child, Object->STR_pattern,
End;
Object->LV_aman = ListObject,
MUIA_Frame, MUIV_Frame_InputList,
MUIA_List_Active, MUIV_List_Active_Top,
MUIA_List_ConstructHook, &lv_confuncHook,
MUIA_List_DestructHook, &lv_desfuncHook,
End;
Object->LV_aman = ListviewObject,
MUIA_HelpNode, "LV_aman",
MUIA_Listview_DoubleClick, TRUE,
MUIA_Listview_List, Object->LV_aman,
End;
GR_listview = GroupObject,
MUIA_HelpNode, "GR_listview",
MUIA_Frame, MUIV_Frame_Group,
MUIA_FrameTitle, "Available Documents",
Child, Object->LV_aman,
End;
GR_aman = GroupObject,
Child, GR_pattern,
Child, GR_listview,
End;
Object->WI_aman = WindowObject,
MUIA_Window_Title, "AMan Doument Selection",
MUIA_Window_ID, MAKE_ID('0', 'W', 'I', 'N'),
WindowContents, GR_aman,
End;
MN_Project_About = MenuitemObject,
MUIA_Menuitem_Title, "About",
MUIA_Menuitem_Shortcut, "?",
End;
MN_Project_Quit = MenuitemObject,
MUIA_Menuitem_Title, "Quit",
MUIA_Menuitem_Shortcut, "Q",
End;
MN_Project = MenuitemObject,
MUIA_Menuitem_Title, "Project",
MUIA_Family_Child, MN_Project_About,
MUIA_Family_Child, MN_Project_Quit,
End;
Object->MN_aman = MenustripObject,
MUIA_Family_Child, MN_Project,
End;
Object->App = ApplicationObject,
MUIA_Application_Author, "Tobias Ferber",
MUIA_Application_Menustrip, Object->MN_aman,
MUIA_Application_Base, "AMAN",
MUIA_Application_Title, "AMan",
MUIA_Application_Version, "$VER: AMan " VERSION " (23.10.94)",
MUIA_Application_Copyright, "Tobias Ferber",
MUIA_Application_Description, "Amiga Manual Browser",
SubWindow, Object->WI_aman,
End;
if (!Object->App)
{
FreeVec(Object);
return(NULL);
}
DoMethod(MN_Project_About,
MUIM_Notify, MUIA_Menuitem_Trigger, MUIV_EveryTime,
Object->App,
2,
MUIM_Application_ReturnID, ID_ABOUT
);
DoMethod(MN_Project_Quit,
MUIM_Notify, MUIA_Menuitem_Trigger, MUIV_EveryTime,
Object->App,
2,
MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit
);
DoMethod(Object->WI_aman,
MUIM_Notify, MUIA_Window_CloseRequest, TRUE,
Object->WI_aman,
3,
MUIM_Set, MUIA_Window_Open, FALSE
);
DoMethod(Object->WI_aman,
MUIM_Notify, MUIA_Window_CloseRequest, TRUE,
Object->App,
2,
MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit
);
DoMethod(Object->STR_pattern,
MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime,
Object->LV_aman,
1,
MUIM_List_Clear);
DoMethod(Object->STR_pattern,
MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime,
Object->WI_aman,
3,
MUIM_Set, MUIA_Window_ActiveObject, Object->LV_aman
);
DoMethod(Object->STR_pattern,
MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime,
Object->App,
2,
MUIM_Application_ReturnID, ID_SUBJECT
);
DoMethod(Object->LV_aman,
MUIM_Notify, MUIA_Listview_DoubleClick, TRUE,
Object->App,
2,
MUIM_Application_ReturnID, ID_SELECT
);
DoMethod(Object->WI_aman,
MUIM_Window_SetCycleChain, Object->STR_pattern,
Object->LV_aman,
0
);
set(Object->WI_aman,
MUIA_Window_Open, TRUE
);
return(Object);
}
void DisposeApp(struct ObjApp * Object)
{
MUI_DisposeObject(Object->App);
FreeVec(Object);
}